import { Opt } from '__com/Opt.js'
import ruleOpt from '@/option/rule.js'

export class editOpt extends Opt {
  constructor(fun) {
    super(fun)
  }

  create() {
    return [
      {
        title: '角色名称',
        key: 'roleName',
        placeholder: '请输入角色名称',
        input: {
          maxlength: 20
        },
        rules: [ruleOpt.required('角色名称不能为空')]
      },
      {
        title: '角色状态',
        key: 'state',
        radio: {
          options: [
            {
              value: '启用',
              key: 1
            },
            {
              value: '禁用',
              key: 0
            }
          ]
        },
        rules: [ruleOpt.required('角色状态不能为空', 'number')]
      },
      {
        title: '备注',
        key: 'roleDesc',
        placeholder: '用于管理接受渠道报备信息，进行确客操作',
        input: {
          showWordLimit: true,
          maxlength: 300,
          autosize: {
            minRows: 4,
            maxRows: 6
          },
          type: 'textarea'
        }
      }
    ]
  }
}
